CC = arm-hisiv300-linux-gcc
LD = arm-hisiv300-linux-gcc

FLAGS =-DHICHIP=0x3518E200 -DSENSOR_TYPE=APTINA_AR0130_DC_720P_30FPS -DHI_RELEASE -DHI_XXXX -DCHIP_ID=CHIP_HI3518E_V200 -lpthread -DISP_V2 -Dhi3518ev200 -DHI_ACODEC_TYPE_INNER
SRCS = $(wildcard *.c)
OBJS = $(patsubst %c, %o, $(SRCS))
DIR := $(shell pwd)
INCDIR = $(DIR)
INC = -I ../include
INC += -I ../include/hisi
INC += -I ../../rtmpdump-2.3/librtmp
LIB = ../lib/libmpi.a ../lib/libive.a ../lib/libmd.a ../lib/libVoiceEngine.a ../lib/libupvqe.a 
LIB += ../lib/libdnvqe.a ../lib/libisp.a ../lib/libsns_ar0130.a ../lib/lib_cmoscfg.a 
LIB += ../lib/lib_iniparser.a ../lib/lib_hiae.a ../lib/lib_hiawb.a ../lib/lib_hiaf.a 
LIB += ../lib/lib_hidefog.a ../../rtmpdump-2.3/librtmp/librtmp.a ../../openssl-1.1.1/libssl.a 
LIB += ../../openssl-1.1.1/libcrypto.a  ../../zlib-1.2.11/libz.a -lpthread -lm -ldl

TARGET = rtmp

.PHONY:all clean

all: $(TARGET)

$(TARGET): $(OBJS)
	$(LD) -o  $@ $^ $(LIB)

%.o:%.c
	$(CC) $(FLAGS) $(INC) -c $^ -g -gdwarf-2 -O0 

clean:
	rm -f $(OBJS) $(TARGET)

